#include<iostream>
using namespace std;
int flo(int f){
    int a[40]={1,1,2};
    for(int i=3;i<f;i++){
        a[i]=a[i-1]+a[i-2];
    }
    return a[f-1];
}
int main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int m;
        cin>>m;
        if(1<=m<=40){
            cout<<flo(m)<<endl;
        }else return 0;
    }
}